
//<![CDATA[

var tips; var theTop = 145/*杩欐槸榛樿楂樺害,瓒婂ぇ瓒婂線涓�*/; var old = theTop;

function initFloatTips() {

tips = document.getElementById('divQQbox');

moveTips();

};

function moveTips() {

var tt=50;
if (window.innerHeight) {
 pos = window.pageYOffset
}else if (document.documentElement && document.documentElement.scrollTop) {
 pos = document.documentElement.scrollTop
}else if (document.body) {
pos = document.body.scrollTop;
}

pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+pos/10;



if (pos < theTop) pos = theTop;
if (pos != old) {
tips.style.top = pos+"px";
tt=10;
}

old = pos;

setTimeout(moveTips,tt);
}

//!]]>

initFloatTips();


if(typeof(HTMLElement)!="undefined")    //缁檉irefox瀹氫箟contains()鏂规硶锛宨e涓嬩笉璧蜂綔鐢�
{
      HTMLElement.prototype.contains=function(obj)
      {
          while(obj!=null&&typeof(obj.tagName)!="undefind"){ //閫氳繃寰幆瀵规瘮鏉ュ垽鏂槸涓嶆槸obj鐨勭埗鍏冪礌
   銆€銆€銆€銆€if(obj==this) return true;
   銆€銆€銆€銆€obj=obj.parentNode;
   銆€銆€}
          return false;
      };
}


function hideMsgBox(theEvent){ //theEvent鐢ㄦ潵浼犲叆浜嬩欢锛孎irefox鐨勬柟寮�
銆€ if (theEvent){
銆€ var browser=navigator.userAgent; //鍙栧緱娴忚鍣ㄥ睘鎬�
銆€ if (browser.indexOf("Firefox")>0){ //濡傛灉鏄疐irefox
銆€ if (document.getElementById('divOnline').contains(theEvent.relatedTarget)) { //濡傛灉鏄瓙鍏冪礌
銆€銆€ return; //缁撴潫鍑藉紡
}

}

if (browser.indexOf("MSIE")>0){ //濡傛灉鏄疘E

if (document.getElementById('divOnline').contains(event.toElement)) { //濡傛灉鏄瓙鍏冪礌

return; //缁撴潫鍑藉紡

}

}

}

/*瑕佹墽琛岀殑鎿嶄綔*/

document.getElementById("divMenu").style.display = "block";


}
// JavaScript Document
var isChrome = navigator.userAgent.toLowerCase().match(/chrome/) != null;

$(function() {
    bindCloseBtn('#service_bar_close'); //涓篒D涓篶lose鐨凞IV娣诲姞鐐瑰嚮浜嬩欢
    bindMiniBtn('#online_service_minibar', '#online_service_fullbar'); //缁戝畾Mini鎸夐挳浜嬩欢
    bindGroupBtn('.service_menu li dl dt'); //鍏夋爣缁忚繃鏄剧ず鍒嗙粍
    showDefaultView(default_view); //灞曞紑鏂瑰紡
    $('.service_menu li.hover dl dd').show();
    scrollAd('#online_service_bar');
    //褰撻〉闈㈠ぇ灏忔敼鍙樻椂
    $(window).scroll(function() {
        scrollAd('#online_service_bar');
    });
});

//鏄剧ず灞曞紑鎴栨敹缂╃姸鎬�
function showDefaultView(status) {
    var cookieValue = getCookie('online_service_status');
    if (cookieValue != "") {
        status = cookieValue;
    }
    if (status == 1) {
        $('#online_service_minibar').hide();
        $('#online_service_fullbar').show();
    } else {
        $('#online_service_fullbar').hide();
        $('#online_service_minibar').show();
    }
    addCookie('online_service_status', status, 720);
}

//涓篒D涓篶lose鐨凞IV娣诲姞鐐瑰嚮浜嬩欢
function bindCloseBtn(obj) {
    $(obj).click(function() {
        $('#online_service_fullbar').hide(1000, function() {
            if (isChrome) {
                $('#online_service_minibar').show();
            }
            else {
                $('#online_service_minibar').show(500);
            }
            addCookie('online_service_status', 0, 720);
        });
    });
}

//缁戝畾Mini鎸夐挳浜嬩欢
function bindMiniBtn(hideObj, showObj) {
    $(hideObj).bind('mouseover', function() {
        showMiniBar(hideObj, showObj);
        addCookie('online_service_status', 1, 720);
    });
}

//鍏夋爣缁忚繃鏄剧ず鍒嗙粍
function bindGroupBtn(obj) {
    $(obj).hover(function() {
        var pobj = $(this).parent().parent();
        $(pobj).stop();
        $(pobj).siblings(".hover").removeClass('hover');
        showServiceMenu(pobj);
    }, function() {
        $(this).parent().parent().stop();
    });
}

//鏄剧ずMini鏍峰紡
function showMiniBar(hideObj, showObj) {
    $(hideObj).hide(500, function() {
        if (isChrome) {
            $(showObj).show();
        }
        else {
            $(showObj).show(500);
        }
    });
}

//鏄剧ず褰撳墠鑿滃崟
function showServiceMenu(obj, speed) {
    speed = speed || 500;
    $(obj).addClass('hover').children('dl').children('dd').slideDown(speed);
    $(obj).siblings().children('dl').children('dd').slideUp(speed);
}

//瀹氫箟涓€涓悕瀛椾负scrollAD鐨勫嚱鏁�
function scrollAd(obj) {
    //瀹氫箟浣嶇Щ涓篺loatdiv鐨勯珮搴﹀姞涓婃粴鍔ㄦ潯鐨勯《閮ㄨ窛绂�
    var offset = $(obj).height() + $(document).scrollTop() - 30;
    //涓篺loatdiv娣诲姞鍔ㄧ敾涓篢OP浣嶇Щoffset鐨勯珮搴︼紝鎸佺画0.8绉掋€�
    $(obj).stop().animate({ top: offset }, 1000);
}

//鍐機ookie
function addCookie(objName, objValue, objHours) {
    var str = objName + "=" + escape(objValue);
    if (objHours > 0) {//涓�0鏃朵笉璁惧畾杩囨湡鏃堕棿锛屾祻瑙堝櫒鍏抽棴鏃禼ookie鑷姩娑堝け
        var date = new Date();
        var ms = objHours * 3600 * 1000;
        date.setTime(date.getTime() + ms);
        str += "; expires=" + date.toGMTString();
    }
    document.cookie = str;
}

//璇籆ookie
function getCookie(objName) {//鑾峰彇鎸囧畾鍚嶇О鐨刢ookie鐨勫€�
    var arrStr = document.cookie.split("; ");
    for (var i = 0; i < arrStr.length; i++) {
        var temp = arrStr[i].split("=");
        if (temp[0] == objName) return unescape(temp[1]);
    }
    return "";
}